<script language="javascript">
function conf(){
    var x=confirm("Bạn có chắc chắn muốn xóa không?");
    if(x==true)
    return true;
    else
    return false;
}

</script>
<?php    
    include("public/includes/headerAdmin.php");
    include("public/includes/popup.php");
?>  <div class="admin-filter">
        <form action="" method="get">
            <input type="hidden" name="rt" value="container" />
            <ul>
            <li>Xem các bài viết</li>
            <li>
                <select name="cbbFilter" onchange="">
                    <option value="0">Tất cả</option>
                <?php                    
                    foreach($this->cat as $value ){                        
                        echo '<option value="'.$value['cat_id'].'">'.$value['cat_name'].'</option>';
                    }
                ?>
                    
                </select>
            </li>
            <li><input class="cmdFilterPost" type="submit" name="cmdFilter" value="Filter" /></li>
            <li><a href="./?rt=addContainer" class="link linkaddnew">Add New</a></li>
        </ul>
        </form>
        
    </div>  
    <div id="content">        
	   <form name="form" action="<?php echo $_SERVER['PHP_SELF'].'?rt=container'; ?>" method="post">
        <div class="viewScroll">
            <table width="1024" border="0" align="center" cellpadding="8" cellspacing="1" id="table">
                <tr id="th">
                  <td colspan="3" align="center"> &nbsp;</span>
                  </td>
                  <td align="center">STT</td>
                  <td align="center">ID</td>
                  <td align="center">Subject</td>
                  <td align="center">Intro</td>
                  <td align="center">Content</td>
                  <td align="center">Address</td>
                  <td align="center">Source</td>
                  <td align="center">Cat_ID</td>
                  <td align="center">Days post</td>
                  <td align="center">Lng</td>
                  <td align="center">Lat</td>
                  <td align="center">Picture</td>
                </tr>
            
            	<?php
                    foreach($this->infoContainer as $key => $value){
                         if($value['stt']%2 ==0)
          	                 echo "<tr id='td' bgcolor='#FFCCCC'>";
                        else 
                            echo " <tr id='td'>";
                            
                        echo '<td width="23" align="center">
                                <input type="checkbox" name="check[]" value="'.$value['id'].'" />
                            </td>
                            <td width="32" align="center">
                                <a href="./?rt=addContainer&action=edit&id='.$value['id'].'" title="Sửa" >
                                    <img src="public/images/b_edit.png" border="0" />
                                </a>
                            </td>
                            <td width="32" align="center">
                                <a href="./?rt=container&action=delete&id='.$value['id'].'" title="Xóa" onclick="return conf();">
                                    <img src="public/images/b_drop.png" border="0" />
                                </a>
                            </td>
                            <td align="center">'.$value['stt'].'</td>
                            <td >'.$value['id'].'</td>
                            <td>'.$value['name'].'</td>
                            <td ><textarea cols="40" rows="5" readonly="">'.$value['gioithieu'].'</textarea></td>
                            <td>'.$value['noidung'].'</td>
                            <td width="140">'.$value['diadiem'].'</td>
                            <td width="140">'.$value['nguon'].'</td>
                            <td width="50">'.$value['cat_id'].'</td>
                            <td width="60">'.$value['ngaypost'].'</td>
                            <td width="100" align="center">'.$value['lng'].'</td>
                            <td width="100" align="center">'.$value['lat'].'</td>
                            <td width="85" align="center"><img src="upload/images/'.$value['anh'].'" width="40px" height="40px"/>
                            </td>
                          </tr>';
                        }
                ?>
                <tr id="tf">                
                    <td colspan="12" align="center" bgcolor="#FFCCCC">
                        <span id="result_box" lang="en" xml:lang="en">Tổng số bài viết: <font color="#FF0000">
                            <b><?php $this->row; ?></b></font> 
                        </span>
                    </td>
              </tr>
              </table>
          </div>
          <input type="submit" name="deleteall" id="link" value="Xóa" style="margin: 10px;" onclick="return conf();"/>
        </form>
    </div>
<?php
    include("public/includes/footerAdmin.php");
?>